<template>
    <div>
        测试组件2---{{ obj.data.a }}
    </div>
</template>

<script setup>
import { emitter } from '@/utils/bus.js'
import { onMounted, reactive } from 'vue'

const obj = reactive({
    data: { a: 999 }
})

onMounted(() => {
    emitter.on('ok', (res) => {
        console.log('接收test兄弟的值：', res)
        obj.data = res;
    })
})
</script>

<style lang="scss" scoped></style>